<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../common/commonJS.jsp" %>
<%@ include file="../common/commonLabel.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>采购单信息新增</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="${pageContext.request.contextPath}/parts/itemjs/ys_stock/purchase.js"></script>
<script type="text/javascript">
//返回
function doback(){
	window.history.back();
	//document.all.operate.value = "";
	//document.forms[0].submit();
}
</script>
</head>
<body>
<form action="<%=path %>/purchase.action" method="post">
<table width="760" border="0" cellpadding="0" cellspacing="0" >
  <tr>
     <td>
     <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" class="MainBody">
      <tr>
        <td class="MainBody_title"><hello:forValue type="title" /></td>
      </tr>
        <tr>
          <td valign="top"><input name="operate" type="hidden" value=""/>
          <input name="pur.createuser" type="hidden" value="${sessionScope.admin_user.personid}"/>
          <div align="right" style="padding: 10 50 10 0;">
			<input type="button" class="btn" value="保 存" onclick="doIns()"/>&nbsp;&nbsp;
			<input type="reset" class="btn" value="重 置" />&nbsp;&nbsp;
			<input type="button" class="btn" value="返 回" onclick="doback()"/>&nbsp;&nbsp;</div>
          <table  border="0" cellpadding="0" cellspacing="0" class="MainBody_table">
                <tr>
                  <td  colspan="6" class="bg_title">供 应 商 信 息</td>
                </tr>
                <tr>
                  <th width="12%" nowrap="nowrap">供应商名称</th> 
                  <td width="28%"><select name="pur.supplierid" style="width: 98%" onchange="doSelsupp(this)" check="checkBlank" title="供应商名称">
                  		<option value="" >请选择</option>
                  		<c:forEach var="supp" varStatus="status" items="${supplist}">
						<option value="${supp.supplierid }" >${supp.suppliername }</option>
						</c:forEach></select></td>
                  <th width="12%" nowrap="nowrap">供应类型</th>
                  <td width="18%"><input name="supplyflag" type="text" class="readinput" readonly/></td>
                  <th width="12%" nowrap="nowrap">评级</th> 
                  <td width="18%"><input name="grade" type="text" class="readinput" readonly/></td>
                </tr>
                <tr>
                  <th nowrap="nowrap">银行账号</th> 
                  <td ><input name="banknumber" type="text" class="readinput" readonly/></td>
                  <th nowrap="nowrap">开户行</th>
                  <td ><input name="bank" type="text" class="readinput" readonly/></td>
                  <th nowrap="nowrap">银行户名</th>
                  <td ><input name="bankname" type="text" class="readinput" readonly/></td>
                </tr>
                <tr>
                  <th nowrap="nowrap">联系人</th>
                  <td ><input name="pur.linkman" type="text" maxlength="20"  check="checkBlank" title="联系人" class="notnull"/></td>
                  <th nowrap="nowrap">电话</th> 
                  <td ><input name="pur.telnumber" type="text" maxlength="50"  check="checkInt" title="电话" /></td>
                  <th nowrap="nowrap">手机</th> 
                  <td><input name="pur.phone" type="text" maxlength="50"  check="checkBlank,checkInt" title="手机" class="notnull"/></td>
                </tr>
			</table>
			<table  border="0" cellpadding="0" cellspacing="0" class="MainBody_table">
				<tr>
                  <td  colspan="6" class="bg_title">采 购 单 信 息</td>
                </tr>
                <tr>
                  <th width="13%" nowrap="nowrap">采购单编号</th>
                  <td width="20%"><input name="pur.purchaseid" type="text" value="${purchaseid}" check="checkBlank" title="采购单编号" class="readinput" readonly/></td>
                  <th width="13%" nowrap="nowrap">采购进度</th> 
                  <td width="20%"><select name="pur.progress" style="width: 98%"></select></td>
                  <th width="13%" nowrap="nowrap">采购员</th> 
                  <td width="20%"><select name="pur.buyer" style="width: 98%" check="checkBlank" title="采购员">
                  		<c:forEach var="buyer" varStatus="status" items="${buyerlist}">
						<option value="${buyer.personname }" <c:if test="${buyer.personname==sessionScope.admin_user.personname}">selected</c:if>>${buyer.personname }</option>
						</c:forEach></select></td>
                </tr>
                <tr>
                  <th nowrap="nowrap">运输类型</th>
                  <td ><select name="pur.carriage" style="width: 98%"></select></td>
                  <th nowrap="nowrap">下单日期</th>
                  <td ><input name="pur.orderdate" type="text" maxlength="50" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true})" class="Wdate"/></td>
                  <th nowrap="nowrap">交货日期</th> 
                  <td ><input name="pur.deliverydate" type="text" maxlength="50" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true})" class="Wdate"/></td>
                </tr>
                <tr>
                  <th align="center" nowrap="nowrap" >备注信息</th> 
                  <td colspan="5"><textarea name="pur.remark" style="width: 100%;" rows="3" onblur="MaxInput(this,100)"></textarea></td>
                </tr>
            </table>
            
            <table  border="0" cellpadding="0" cellspacing="0" class="MainBody_table">
            	<tbody>
				<tr>
                  <td colspan="6" class="bg_title" nowrap="nowrap"><div style="width:90%;height:100%;float: left;">原 材 料 信 息</div>
                  <div style="float: right;"><input type="button" class="btn" value="添加" onclick="addMak(this)"/>&nbsp;&nbsp;</div></td>
                </tr>
                <tr>
                  <th width="12%" nowrap="nowrap">物料名称</th>
                  <td width="28%"><select name="goodsid" style="width: 98%" onclick="doSelmak(this)" check="checkBlank" >
                  		<option value="" >请选择</option>
                  		<c:forEach var="mak" varStatus="status" items="${makingslist}">
						<option value="${mak.goodsid }" <c:if test="${goodsid==mak.goodsid}">selected</c:if>>${mak.goodsname }</option>
						</c:forEach></select></td>
                  <th width="12%" nowrap="nowrap">种类</th> 
                  <td width="18%"><input name="goodstype" type="text" readonly class="readinput" /></td>
                  <th width="12%" nowrap="nowrap">规格</th> 
                  <td width="18%"><input name="standard" type="text" readonly class="readinput" /></td>
                </tr>
                <tr>
                	<th nowrap="nowrap">品牌</th> 
                  <td ><input name="brand" type="text" readonly class="readinput"/></td>
                  <th nowrap="nowrap">参考单位</th> 
                  <td ><input name="unit" type="text" readonly class="readinput"/></td>
                  <th nowrap="nowrap">参考单价</th> 
                  <td ><input name="priceone" type="text" readonly class="readinput"/></td>
                </tr>
                <tr>
                  <th nowrap="nowrap"><input name="makingtype" type="hidden" value=""/>采购单价</th> 
                  <td ><input name="buyprice" type="text" maxlength="50" check="checkBlank,checkNaN" class="notnull" onblur="doObj(this)"/></td>
                  <th nowrap="nowrap">采购数量</th> 
                  <td ><input name="buynum" type="text" maxlength="50" check="checkBlank,checkNaN" class="notnull" onblur="doObj(this)"/></td>
                  <th nowrap="nowrap">总金额</th> 
                  <td ><input name="summoney" type="text" maxlength="50" check="checkBlank,checkNaN" class="notnull" onblur="doObj(this)"/></td>
                </tr>
                <tr>
                  <th nowrap="nowrap">核算单价</th> 
                  <td ><input name="price" type="text" readonly class="readinput"/></td>
                  <th nowrap="nowrap">核算数量</th>
                  <td ><input name="sumgoods" type="text" readonly class="readinput"/></td>
                  <th nowrap="nowrap">采购单位</th>
                  <td ><select name="buyunit" style="width: 98%" onchange="doObj(this)" >
						<option value="其他" >其他</option>
						<option value="吨" >吨</option>
						<option value="领" >领</option>
						</select></td>
                </tr>
                <tr>
                  <th align="center" nowrap="nowrap" >备注信息</th> 
                  <td colspan="5"><textarea name="remark" style="width: 100%;" rows="2" onblur="MaxInput(this,100)"></textarea></td>
                </tr>
                </tbody>
            </table>
		</td>
	</tr>
</table></td></tr></table>
<script type="text/javascript">
<c:if test="${!empty goodsid}">doSelmak(document.all["goodsid"])</c:if>
doSelectInfo(document.all["pur.progress"],'progress','',false);
doSelectInfo(document.all["pur.carriage"],'carriage','');
doDate("pur.orderdate");
</script>
</form>
</body>
</html>